Odoo / UI / *Add New tab to existing module
New tab to existing module
-
Step 1:
Task is to add new tab for file uploading
1. _mainfest.py
1. add depends module
2. add view xml
'depends' : ['hr', 'account'], 'data': [ 'views/hr_employee_views.xml' ], 2. model
1. add '_inherit'
2. add new field
class HrEmployee(models.Model): _inherit = 'hr.employee' attachment_ids = fields.One2many('ir.attachment', 'id') 3. view
1. add position
2. add name
Complete code
custom.employee.form.view hr.employee